import { defineStore } from "pinia";

export const UserVideoStore = defineStore("VideoStore", {
  state: () => {
    return {
      videoURL: {
        type: String,
        default: "",
      },
      videoPoster: {
        type: String,
        default: "",
      },
      videoNeed: {
        type: Boolean,
        default: false,
      },
    };
  },
  actions: {
    CloseVideoPlayer() {
      this.videoNeed = false;
      this.videoPoster = "";
      this.videoURL = "";
    },
    PlayVideo(source) {
      console.log(source);
      this.videoURL = source.videoUrl;
      this.videoPoster = source.videoPoster;
      this.videoNeed = true;
    },
  },
});
